﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjectEulerSolutions
{
    /*
     * The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.

        Find the sum of all the primes below two million.
     * 
     * */
    class Problem10
    {
        public static string Calculate()
        {
            long sum = 0;
            int maxPrime = 0;

            int limit = 2000000;

            int i = 1;

            while (i < limit)
            {
                i++;
                if (Problem7.IsPrime(i))
                {
                    sum += i;
                    maxPrime = i;
                    Console.WriteLine(i);
                }
            }

            return sum.ToString();
        }
    }
}
